//this class suport interface that a concrete timer should implement
//andycai_sc 2011-05-27

#ifndef GTIMERIMPL_H
#define GTIMERIMPL_H

#include "GParallel/GTimer.h"

class GTimerImpl
{
public:
	virtual ~GTimerImpl() {}

	virtual void beginImpl(long millisc) = 0;
	
	virtual void cancelImpl() = 0;

	void exec() { m_timer->schedule(); }

protected:
	GTimerImpl(GTimer* timer) : m_timer(timer)
	{
	}

private:
	GTimer* m_timer;
};

class GTimerImplCreator
{
public:
	static GTimerImpl* create(GTimer* timer);
};

GTimerImpl* createTimerFromAce(GTimer* timer);
GTimerImpl* createTimerFromPoco(GTimer* timer);
GTimerImpl* createTimerFromQt(GTimer* timer);
GTimerImpl* createTimerFromGToy(GTimer* timer);

#endif
